home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#40 (Jan 89)
/
Help.sit
/
PackMacs.Txt
< prev
next >
Wrap
Text File
|
1986-07-11
|
12KB
|
545 lines
; File: PackMacs.txt
;
; Version 2.0
;
; Copyright 1984, 1985, 1986 Apple Computer, Inc. All Rights Reserved
;
;
; Package Equates -- This file defines the high-level equates for the
; Standard File, Disk Initialization, International Utilities, and
; Binary-Decimal Conversion packages, and the List Manager. The equates
; for the Floating-PointArithmetic and Transcendental Functions packages
; can be found in SANEMacs.a.
listMgr EQU 0 ; List Manager
; 1 reserved for use by Apple Computer, Inc.
dskInit EQU 2 ; Disk Initialization
stdFile EQU 3 ; Standard File
flPoint EQU 4 ; Floating-Point Arithmetic
trFunc EQU 5 ; Transcendental Functions
intUtil EQU 6 ; International Utilities
bdConv EQU 7 ; Binary/Decimal Conversion
; Equates for STANDARD FILE PACKAGE
putDlgID EQU -3999 ; SFPutFile dialog template ID
getDlgID EQU -4000 ; SFGetFile dialog template ID
putSave EQU 1 ; save button
putCancel EQU 2 ; cancel button
putEject EQU 5 ; eject button
putDrive EQU 6 ; drive button
putName EQU 7 ; editTExt item for file name
getOpen EQU 1 ; open button
getCancel EQU 3 ; cancel button
getEject EQU 5 ; eject button
getDrive EQU 6 ; drive button
getNmList EQU 7 ; userItem for file name list
getScroll EQU 8 ; userItem for scroll bar
; Reply record data structure
rGood EQU 0 ; ignore command if FALSE
rType EQU 2 ; file type
rVolume EQU 6 ; volume reference number
rVersion EQU 8 ; file's version number
rName EQU 10 ; file name
; Routine selectors
sfPutFile EQU 1
sfPPutFile EQU 3
sfGetFile EQU 2
sfPGetFile EQU 4
; Equates for DISK INITIALIZATION PACKAGE
; Routine selectors
diLoad EQU 2
diUnload EQU 4
diBadMount EQU 0
diFormat EQU 6
diVerify EQU 8
diZero EQU 10
; Result codes are defined in SysEqu.a
; Equates for INTERNATIONAL PACKAGE
; Routine selectors
iuGetIntl EQU 6
iuSetIntl EQU 8
iuDateString EQU 0
iuDatePString EQU 14
iuTimeString EQU 2
iuTimePString EQU 16
iuMetric EQU 4
iuMagString EQU 10
iuMagIDString EQU 12
; Data structures for International Utilities
; International 0 record
decimalPt EQU 0 ; ASCII character for decimal point
thousSep EQU 1 ; ASCII character for thousand separator
listSep EQU 2 ; ASCII character for list separator
currSym EQU 3 ; ASCII for currency symbol (3 bytes long)
currFmt EQU 6 ; currency format flags
dateOrder EQU 7 ; short date form - DMY,YMD, or MDY
shrtDateFmt EQU 8 ; date elements format flag
dateSep EQU 9 ; ASCII for date separator
timecycle EQU 10 ; indicates 12 or 24 hr cycle
timeFmt EQU 11 ; time elements format flags
mornStr EQU 12 ; ASCII for trailing string from 0:00 to 11:59
eveStr EQU 16 ; ASCII for trailing string from 12:00 to 23:59
timeSep EQU 20 ; ASCII for the time separator
timeSuff EQU 21 ; suffix string used in 24 hr mode
metricSys EQU 29 ; indicates metric or English system
intl0Vers EQU 30 ; version: high byte = country. low byte = vers
; International 1 record
days EQU 0
months EQU 112
suppressDay EQU 304
lngDateFmt EQU 305
dayLeading0 EQU 306
abbrLen EQU 307
st0 EQU 308
st1 EQU 312
st2 EQU 316
st3 EQU 320
st4 EQU 324
intl1Vers EQU 328
localRtn EQU 330
; Constants for manipulation of international resources
; Way to specify desired date format
shortDate EQU 0
longDate EQU 1
abbrevDate EQU 2
; Masks used for setting and testing currency format flags
currLeadingZ EQU 128 ; set if leading zero
currTrailingZ EQU 64 ; set if trailing zero
currNegSym EQU 32 ; set if minus sign for negative num, reset if parentheses}
currSymLead EQU 16 ; set if currency symbol leads, reset if trails}
; Constants specifying absolute value of short date form
mdy EQU 0 ; month,day,year
dmy EQU 1 ; day,month,year
ymd EQU 2 ; year,month,day
; Masks used for date element format flags
century EQU 128 ; set if century, reset if no century
mntLdingZ EQU 64 ; set if leading 0 for month
dayLdingZ EQU 32 ; set if leading zero for day
; Masks used for time element format flags
hrLeadingZ EQU 128 ; set if leading zero for hours
minLeadingZ EQU 64 ; set if leading zero for minutes
secLeadingZ EQU 32 ; set if leading zero for seconds
; Country codes for version numbers
verUS EQU 0
verFrance EQU 1
verBritain EQU 2
verGermany EQU 3
verItaly EQU 4
verNetherlands EQU 5
verBelgiumLux EQU 6
verSweden EQU 7
verSpain EQU 8
verDenmark EQU 9
verPortugal EQU 10
verFrCanada EQU 11
verNorway EQU 12
verIsrael EQU 13
verJapan EQU 14
verAustralia EQU 15
verArabia EQU 16
verFinland EQU 17
verFrSwiss EQU 18
verGrSwiss EQU 19
verGreece EQU 20
verIceland EQU 21
verMalta EQU 22
verCyprus EQU 23
verTurkey EQU 24
verYugoslavia EQU 25
; Equates for BINARY-DECIMAL CONVERSION PACKAGE
; Routine selectors
numToString EQU 0
stringToNum EQU 1
; List Manager Equates
rView EQU 0 ; Rect in which we are viewed
port EQU 8 ; Grafport that owns us
indent EQU 12 ; Indent line/fields in cell
cellSize EQU 16 ; Cell size
visible EQU 20 ; lines/fields visible bounds
vScroll EQU 28 ; vertical scroll bar (or NIL)
hScroll EQU 32 ; horizontal scroll bar (or NIL)
selFlags EQU 36 ; Multiple selections allowed
lActive EQU 37 ; active or inactive boolean
lReserved EQU 38 ; private flags used internally
listFlags EQU 39 ; autoscrolling flags, etc.
clikTime EQU 40 ; time of last click
clikLoc EQU 44 ; position of last click
mouseLoc EQU 48 ; current position of mouse
lClikLoop EQU 52 ; routine to call during ListClick
lastClick EQU 56 ; the last cell that was clicked in
refCon EQU 60 ; reference value
listDefHandle EQU 64 ; Handle to list defproc
userHandle EQU 68 ; general storage for user
dataBounds EQU 72 ; Bounds of lines/fields
cells EQU 80 ; Handle to data
maxIndex EQU 84 ; index of lastcell + 1
cellArray EQU 86 ; offsets to cells
sizeList EQU 86 ; size sans selections
; these are equates for accessing the SelFlags byte
; All flags are true if one
lOnlyOne EQU 7 ; 0 = multiple selections, 1 = one
lExtendDrag EQU 6 ; 1 = drag select without shift key
lNoDisjoint EQU 5 ; 1 = turn off selections on click
lNoExtend EQU 4 ; 1 = don't extend shift selections
lNoRect EQU 3 ; 1 = don't grow (shift,drag) selection as rect
lUseSense EQU 2 ; 1 = shift should use sense of start cell
lNoNilHilite EQU 1 ; 1 = don't hilite empty cells
; these are bit numbers within the listFlags byte
; All flags are true if one
lDoVAutoscroll EQU 1 ; 1 = allow vertical autoscrolling
lDoHAutoscroll EQU 0 ; 1 = allow horizontal autoscrolling
; these are the messages sent to a list defproc
lInitMsg EQU 0 ; tell drawing routines to init themselves
lDrawMsg EQU 1 ; draw (and de/select) the indicated data
lHiliteMsg EQU 2 ; invert hilite state of specified cell
lCloseMsg EQU 3 ; shut down, the list is being disposed
; For package invocation
; First arg is routine selector, second is the trap
.MACRO _PackCall
MOVE.W %1,-(SP)
%2
.ENDM
;QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
; Disk Initialization
;QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
.MACRO _DILoad
_PackCall #DILoad,_Pack2
.ENDM
.MACRO _DIUnLoad
_PackCall #DIUnLoad,_Pack2
.ENDM
.MACRO _DIBadMount
_PackCall #DIBadMount,_Pack2
.ENDM
.MACRO _DIFormat
_PackCall #DIFormat,_Pack2
.ENDM
.MACRO _DIVerify
_PackCall #DIVerify,_Pack2
.ENDM
.MACRO _DIZero
_PackCall #DIZero,_Pack2
.ENDM
;QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
; Standard File
;QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
.MACRO _SFPutFile
_PackCall #SFPutFile,_Pack3
.ENDM
.MACRO _SFPPutFile
_PackCall #SFPPutFile,_Pack3
.ENDM
.MACRO _SFGetFile
_PackCall #SFGetFile,_Pack3
.ENDM
.MACRO _SFPGetFile
_PackCall #SFPGetFile,_Pack3
.ENDM
;QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
; International Utilities
;QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
.MACRO _IUGetIntl
_PackCall #IUGetIntl,_Pack6
.ENDM
.MACRO _IUSetIntl
_PackCall #IUSetIntl,_Pack6
.ENDM
.MACRO _IUDateString
_PackCall #IUDateString,_Pack6
.ENDM
.MACRO _IUDatePString
_PackCall #IUDatePString,_Pack6
.ENDM
.MACRO _IUTimeString
_PackCall #IUTimeString,_Pack6
.ENDM
.MACRO _IUTimePString
_PackCall #IUTimePString,_Pack6
.ENDM
.MACRO _IUMetric
_PackCall #IUMetric,_Pack6
.ENDM
.MACRO _IUMagString
_PackCall #IUMagString,_Pack6
.ENDM
.MACRO _IUMagIDString
_PackCall #IUMagIDString,_Pack6
.ENDM
;QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
; Binary-Decimal Conversion
;QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
.MACRO _StringToNum
_PackCall #stringToNum,_Pack7
.ENDM
.MACRO _NumToString
_PackCall #numToString,_Pack7
.ENDM
;---------------------------------------------------------------------------
;
; These are the definitions for the List Manager calls
; implemented as Pack0.
;
;---------------------------------------------------------------------------
lActivate EQU 0
lAddColumn EQU 4
lAddRow EQU 8
lAddToCell EQU 12
lAutoScroll EQU 16
lCellSize EQU 20
lClick EQU 24
lClrCell EQU 28
lDelColumn EQU 32
lDelRow EQU 36
lDispose EQU 40
lDoDraw EQU 44
lDraw EQU 48
lFind EQU 52
lGetCell EQU 56
lGetSelect EQU 60
lLastClick EQU 64
lNew EQU 68
lNextCell EQU 72
lRect EQU 76
lScroll EQU 80
lSearch EQU 84
lSetCell EQU 88
lSetSelect EQU 92
lSize EQU 96
lUpdate EQU 100
.MACRO _LActivate
_PackCall #lActivate,_Pack0
.ENDM
.MACRO _LAddColumn
_PackCall #lAddColumn,_Pack0
.ENDM
.MACRO _LAddRow
_PackCall #lAddRow,_Pack0
.ENDM
.MACRO _LAddToCell
_PackCall #lAddToCell,_Pack0
.ENDM
.MACRO _LAutoScroll
_PackCall #lAutoScroll,_Pack0
.ENDM
.MACRO _LCellSize
_PackCall #lCellSize,_Pack0
.ENDM
.MACRO _LClick
_PackCall #lClick,_Pack0
.ENDM
.MACRO _LClrCell
_PackCall #lClrCell,_Pack0
.ENDM
.MACRO _LDelColumn
_PackCall #lDelColumn,_Pack0
.ENDM
.MACRO _LDelRow
_PackCall #lDelRow,_Pack0
.ENDM
.MACRO _LDispose
_PackCall #lDispose,_Pack0
.ENDM
.MACRO _LDoDraw
_PackCall #lDoDraw,_Pack0
.ENDM
.MACRO _LDraw
_PackCall #lDraw,_Pack0
.ENDM
.MACRO _LFind
_PackCall #lFind,_Pack0
.ENDM
.MACRO _LGetCell
_PackCall #lGetCell,_Pack0
.ENDM
.MACRO _LGetSelect
_PackCall #lGetSelect,_Pack0
.ENDM
.MACRO _LLastClick
_PackCall #lLastClick,_Pack0
.ENDM
.MACRO _LNew
_PackCall #lNew,_Pack0
.ENDM
.MACRO _LNextCell
_PackCall #lNextCell,_Pack0
.ENDM
.MACRO _LRect
_PackCall #lRect,_Pack0
.ENDM
.MACRO _LScroll
_PackCall #lScroll,_Pack0
.ENDM
.MACRO _LSearch
_PackCall #lSearch,_Pack0
.ENDM
.MACRO _LSetCell
_PackCall #lSetCell,_Pack0
.ENDM
.MACRO _LSetSelect
_PackCall #lSetSelect,_Pack0
.ENDM
.MACRO _LSize
_PackCall #lSize,_Pack0
.ENDM
.MACRO _LUpdate
_PackCall #lUpdate,_Pack0
.ENDM